﻿namespace DirectoryServicesProtocolsExtensions.LdapConnection.MetaData
{
    using System.Collections.Generic;
    using System.Data;

    public static class LdapToSQLSchemaGenerator
    {
        public static DataTable CreateDataTableSchemaFromLDAPAttributeList(
            IEnumerable<LdapAttributeMetaMap> ldapAttributesMetaMaps)
        {
            var table = new DataTable();
            foreach (var metaMap in ldapAttributesMetaMaps)
            {
                table.Columns.Add(
                    new DataColumn(
                        metaMap.LdapDisplayName,
                        metaMap.RawDotNetTypeEquivalent));
            }
             
            return table;
        }
    }
}
